<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/WEB-INF/views/common.jsp"%>
    <script type="text/javascript" src="/static/views/employee.js"></script>
</head>
<body>
<!--在这里使用的是dialog和form表单结合的方式-->
<div id="employee_dialog">
    <form action="employee_save.json" id="editForm" method="post">
        <!--在这里给一个id的隐藏域-->
        <input type="hidden" name="id"/>
        <table align="center" style="margin-top: 20px">
            <tr>
                <td>员工姓名</td>
                <td>
                    <input name="username" type="text"/>
                </td>
            </tr>
            <tr>
                <td>真实姓名</td>
                <td>
                    <input name="realName" type="text"/>
                </td>
            </tr>
            <tr>
                <td>联系方式</td>
                <td>
                    <input name="tel" type="text"/>
                </td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td>
                    <input name="email" type="text"/>
                </td>
            </tr>
            <tr>
            <td>所属部门</td>
            <td>
                <input  class="easyui-combobox" name="department.id" data-options="
                url:'/department/listAll.do',
                valueField: 'id',
                textField: 'name',
                width:200
                " />
            </td>
            </tr>
            <tr>
            <td>角色</td>
            <td>
                <input id="employee_roles" class="easyui-combobox" data-options="
                url:'/role/listAll.do',
                valueField: 'id',
                textField: 'name',
                multiple:true,
                width:200
                " />
            </td>
            </tr>
        </table>
    </form>
</div>

    <table id="employee_datagrid"></table>
    <!--底部的按钮-->
    <div id="dialog_bt">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" data-cmd="save">保存</a>
        <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" data-cmd="cancel">取消</a>
    </div>
    <div id="tb">
        <div>
            <a class="easyui-linkbutton" data-cmd="add" data-options="iconCls:'icon-add',plain:true">添加</a>
            <a class="easyui-linkbutton" id="editBtn" data-cmd="edit" data-options="iconCls:'icon-edit',plain:true">编辑</a>
            <a class="easyui-linkbutton" id="quitBtn" data-cmd="remove" data-options="iconCls:'icon-remove',plain:true">离职</a>
            <a class="easyui-linkbutton"  data-cmd="reload" data-options="iconCls:'icon-reload',plain:true">刷新</a>
        </div>
        <div>
            <input id="searchBtn" class="easyui-textbox" style="width:200px"data-options="
            iconCls:'icon-search',
            buttonText:'搜索',
            prompt:'用户名/邮箱',
            onClickButton:function(){
                var value = $('#searchBtn').textbox('getValue');
                 $('#employee_datagrid').datagrid('load',{
                    keyword:value
                    });
                }
            "/>
        </div>
    </div>
</body>
</html>
